//-----------------------------------------------------------------------
// <copyright file="Task.cs" company="Simnova LLC">
//     Copyright (c) Simnova LLC. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Simnova.Collaborate.ServiceContract.DataClasses
{
    using System;
    using System.Runtime.Serialization;

    /// <summary>
    /// The Task Class
    /// </summary>
    [DataContract]
    public class Task
    {
        /// <summary>
        /// The Task ID
        /// </summary>
        [DataMember(Name = "TaskId")]
        private int taskId;

        /// <summary>
        /// The UserID Field
        /// </summary>
        private int userId;

        /// <summary>
        /// The ProjectId Field
        /// </summary>
        private int projectId;

        /// <summary>
        /// The Name Field
        /// </summary>
        private string name;

        /// <summary>
        /// The IsComplete Field
        /// </summary>
        private int isComplete;

        /// <summary>
        /// The EstimatedHours Field
        /// </summary>
        private int estimatedHours;

        /// <summary>
        /// Gets the TaskId
        /// </summary>
        public int TaskId
        {
            get { return this.taskId; }
        }

        /// <summary>
        /// Gets or sets the UserId
        /// </summary>
        [DataMember]
        public int UserId
        {
            get { return this.userId; }
            set { this.userId = value; }
        }

        /// <summary>
        /// Gets or sets the ProjectId
        /// </summary>
        [DataMember]
        public int ProjectId
        {
            get { return this.projectId; }
            set { this.projectId = value; }
        }

        /// <summary>
        /// Gets or sets the Name
        /// </summary>
        [DataMember]
        public string Name
        {
            get { return this.name; }
            set { this.name = value; }
        }

        /// <summary>
        /// Gets or sets a value indicating whether the task is Complete or not.
        /// </summary>
        [DataMember]
        public bool IsComplete
        {
            get { return this.isComplete != 0; }
            set { this.isComplete = (value ? 1 : 0); }
        }

        /// <summary>
        /// Gets or sets EstimatedHours
        /// </summary>
        [DataMember]
        public int EstimatedHours
        {
            get { return this.estimatedHours; }
            set { this.estimatedHours = value; }
        }
    }
}
